<!--
<script setup>


</script>

<template>
  <el-container>
    <el-header>XX管理系统</el-header>
    <el-container style="text-align: right">
      <el-aside style="width:180px; text-align: left" >
        <el-menu>
          <el-submenu router>
            <el-menu-item  name="home">
              <router-link   to="/">首页</router-link>
            </el-menu-item>
            <el-menu-item  name="login" >
              <router-link   to="/login">登录</router-link>
            </el-menu-item>
            <el-menu-item  name="message" >
              <router-link   to="/message">消息</router-link>
            </el-menu-item>
            <el-menu-item route="/account" name="account" >
              <router-link   to="/account">账号</router-link>
            </el-menu-item>
            <el-menu-item  name="order" >
              <router-link   to="/order">订单</router-link>
            </el-menu-item>
            <el-menu-item  name="recharge" >
              <router-link   to="/recharge">充值</router-link>
            </el-menu-item>
            <el-menu-item  name="user">
              <router-link   to="/user">用户管理</router-link>
            </el-menu-item>
            <el-menu-item  name="express">
              <router-link   to="/express">快递消息</router-link>
            </el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main><routerView/></el-main>
    </el-container>
  </el-container>
</template>
<style scoped>

.el-header{
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;

  text-align: left;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

.el-menu {
  background-color: #d3dce6;
}
</style>
-->


<template>
  <el-container style="text-align: center">

    <el-aside  style="width: auto;">
      <el-menu router background-color="#545c64" text-color="#fff"
               :collapse="isCollapse"
               style="height: 600px;"

      >
        <el-menu-item index="/scenicspot" route="/scenicspot">
          <el-icon><location /></el-icon>
          <template #title >景区分类</template>
        </el-menu-item>

        <el-menu-item index="/regional" route="/regional">
          <el-icon><setting /></el-icon>
          <template #title> 地区管理</template>
        </el-menu-item>

        <el-menu-item index="/order" route="/order">
          <el-icon><setting /></el-icon>
          <template #title> 订单管理</template>
        </el-menu-item>

        <el-menu-item index="/comment" route="/comment">
          <el-icon><setting /></el-icon>
          <template #title> 评论管理</template>
        </el-menu-item>

        <el-menu-item index="/user" route="/user">
          <el-icon><setting /></el-icon>
          <template #title> 用户管理</template>
        </el-menu-item>

        <el-sub-menu  index="shop">
          <template #title>
            <el-icon><location /></el-icon>
            <span>店铺管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/shop" route="/shop">
              <el-icon><setting /></el-icon>
              <template #title><span>门店管理</span></template>
            </el-menu-item>
            <el-menu-item index="/shoplog" route="/shoplog">
              <el-icon><setting /></el-icon>
              <template #title><span>门店操作日志</span></template>
            </el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>

        <el-sub-menu index="run">
          <template #title>
            <el-icon><location /></el-icon>
            <span>运营管理</span>
          </template>
          <el-menu-item-group >
            <el-menu-item index="/advertise" route="/advertise">
              <el-icon><setting /></el-icon>
              <template #title><span>广告管理</span></template>
            </el-menu-item>
            <el-menu-item index="/notice" route="/notice">
              <el-icon><setting /></el-icon>
              <template #title><span>通知管理</span></template>
            </el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>

        <el-sub-menu index="log">
          <template #title>
            <el-icon><location /></el-icon>
            <span>日志管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/loginlog" route="/loginlog">
              <el-icon><setting /></el-icon>
              <template #title><span>登录日志</span></template>
            </el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>

        <el-menu-item index="/analysis" route="/analysis">
          <el-icon><setting /></el-icon>
          <template #title><span>统计分析</span></template>
        </el-menu-item>
      </el-menu>
    </el-aside>


    <el-container>
      <el-header>
        <table style="width: 100%;height: 60px">
          <tr >
            <th  style=" text-align: left ;">
              <el-radio-group  v-model="isCollapse">
                <el-radio-button :value="false">expand</el-radio-button>
                <el-radio-button :value="true">expand</el-radio-button>
              </el-radio-group>
              </th>
            <th width="100px" style="font-size: large"><span>山水有🌤</span></th>
            <th width="100px"  style="text-align: right">
              <el-dropdown>

                <el-avatar  shape="circle" style="width: 40px;height: 40px; margin-top:8px;" src="src/views/img.png" />
                <template #dropdown>
                  <el-dropdown-menu >
                    <el-dropdown-item>
                      <router-link to="/" style="text-decoration: none; color: #606266">登录</router-link>
                    </el-dropdown-item>
                    <el-dropdown-item @click="cancel" >
                      登出
                    </el-dropdown-item>
                  </el-dropdown-menu>
                </template>
              </el-dropdown>
            </th>
          </tr>
        </table>
      </el-header>

      <el-main>
        <el-scrollbar max-height="516px">
          <div style="margin: 20px;">
            <routerView/>
          </div>
        </el-scrollbar>
      </el-main>
    </el-container>
  </el-container>
</template>
<script lang="ts" setup>
import {useRouter} from "vue-router";
import { ref } from 'vue'

import CommonAside from "@/pages/common-aside.vue";
import {Location, Setting} from "@element-plus/icons-vue";
const router = useRouter();

const isCollapse = ref(true)
const cancel =  () => {
  router.push('/');
  alert('退出登录');
}


</script>

<style scoped>

.el-header{
  background-color: #ffffff;
  color: #2c3e50;
  line-height: 60px;
  margin-bottom: 20px;
}

.el-main {
  background-color: white;
  color: #333;
  margin-left: 20px;
  margin-right: 20px;
  height:  518px;
  text-align: center;
  line-height: 32px;
  padding: 0;
}


</style>
